Cytosim  PI
Cytoskeleton Simulator
Matrix3 Class Reference
Inheritance diagram for Matrix3:
MatrixBase< 3 >

Public Member Functions

 Matrix3 ()
 constructor
 
 Matrix3 (MatrixBase< 3 > const &m)
 automatic conversion from MatrixBase<3>
 
real rotationAngle () const
 rotation angle
 
void getEulerAngles (real &angle, real &, real &) const
 calculate rotation angle and Euler angle of axis
 
- Public Member Functions inherited from MatrixBase< 3 >
 MatrixBase ()
 The default creator does not initialize.
 
 MatrixBase (real v[SZ][SZ])
 Copy-creator from a C-style array.
 
 MatrixBase (real v[SZ *SZ])
 Copy-creator from a Fortran-style array.
 
virtual ~MatrixBase ()
 The default destructor does nothing.
 
void makeZero ()
 set all components to zero
 
void makeIdentity ()
 set to Identity (ones on the diagonal, zero elsewhere)
 
 operator real * ()
 conversion to a modifiable real array
 
realoperator() (const unsigned ii, const unsigned jj)
 access to modifiable elements of the matrix by (line, column)
 
realoperator[] (const unsigned ii)
 access to modifiable elements by index in the array
 
void getColumn (const unsigned jj, real vec[SZ]) const
 extract column vector at index jj
 
void setColumn (const unsigned jj, const real vec[SZ])
 set column vector at index jj
 
void getLine (const unsigned ii, real vec[SZ]) const
 extract line vector at index ii
 
void setLine (const unsigned ii, const real vec[SZ])
 set line vector at index ii
 
MatrixBase transposed () const
 return the transposed matrix
 
void transpose ()
 transpose this matrix
 
real determinant () const
 return the determinant of the matrix
 
MatrixBase inverted () const
 return the inverse of the matrix
 
void inverse ()
 replace by the inverse
 
real maxNorm () const
 maximum of all fabs(element)
 
void write (std::ostream &os) const
 formatted output
 
real maxDeviationFromRotation () const
 calculate a distance to the subspace of rotations = maxNorm( M'*M - Id )
 
void operator*= (const real a)
 multiply the matrix by the real scalar a
 
void operator/= (const real a)
 divide the matrix by the real scalar a
 
void operator+= (const MatrixBase m)
 add matrix m
 
void operator-= (const MatrixBase m)
 subtract matrix m
 
void vecMul (const real *in, real *out) const
 Vector multiplication: out <- M * in.
 
void vecMul (real *vec) const
 Vector multiplication: vec <- M * vec.
 

Static Public Member Functions

static Matrix3 rotationAroundAxisEuler (const real a[3])
 
static Matrix3 rotationFromEulerAngles (const real a[3])
 return rotation of angle a, around axis of azimuth b and elevation c
 
static Matrix3 rotationAroundX (real angle)
 a rotation of angle a, around the X axis
 
static Matrix3 rotationAroundPrincipalAxis (unsigned axis, real angle)
 a rotation of angle a, around one of the main axis X, Y or Z
 
static Matrix3 rotationAroundAxis (const Vector3 &, real angle)
 a rotation around the given axis
 
static Matrix3 rotationAroundAxis (const Vector3 &)
 a rotation around the given axis, or angle=norm(x)
 
static Matrix3 rotationToVector (const Vector3 &)
 return a rotation that transforms (1,0,0) into vec ( norm(vec) should be > 0 )
 
static Matrix3 rotationToVector (const Vector3 &, Random &)
 return a random rotation that transforms (1,0,0) into vec ( norm(vec) should be > 0 ) More...
 
static Matrix3 randomRotation (Random &)
 a random rotation chosen uniformly
 
- Static Public Member Functions inherited from MatrixBase< 3 >
static MatrixBase one ()
 return identity matrix (ones on the diagonal, zero elsewhere)
 
static MatrixBase zero ()
 return zero matrix
 
static MatrixBase projectionMatrix (const real V[])
 build the projection matrix V * V'
 

Additional Inherited Members

- Public Attributes inherited from MatrixBase< 3 >
real val [SZ *SZ]
 the array of value, column-major
 

Member Function Documentation

Matrix3 rotationToVector ( const Vector3 vec,
Random rng 
)
static

In 3D, this rotation is chosen uniformly among all the rotation transforming (1,0,0) into vec. The function will fail if ( vec == 0 ).